package com.mapas;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Point;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapView;
import com.google.android.maps.Overlay;
import com.google.android.maps.Projection;

public class dibujoLinea extends Overlay
{
	private Projection pro;
	
	public dibujoLinea(Projection proy) 
	{
		pro=proy;
	}
	public void draw(Canvas canvas, MapView mapv, boolean shadow){
        super.draw(canvas, mapv, shadow);

    Paint   mPaint = new Paint();
        mPaint.setDither(true);
        mPaint.setColor(Color.BLUE);
        mPaint.setStyle(Paint.Style.STROKE);
        mPaint.setStrokeJoin(Paint.Join.MITER);
        mPaint.setStrokeCap(Paint.Cap.BUTT);
        mPaint.setStrokeWidth(2);

        Double latitude = -37.999832*1E6;
		Double longitude = -57.546988*1E6;
		
		GeoPoint gP1;
		GeoPoint gP2;
		
			gP1 = new
			GeoPoint(latitude.intValue(),longitude.intValue());
			
			latitude=-38.001337*1E6;
			longitude=-57.549798*1E6;
			
			gP2 = new
			GeoPoint(latitude.intValue(),longitude.intValue());

        Point p1 = new Point();
        Point p2 = new Point();

    Path    path = new Path();

        pro.toPixels(gP1, p1);
        pro.toPixels(gP2, p2);

        path.moveTo(p2.x, p2.y);
        path.lineTo(p1.x,p1.y);

        canvas.drawPath(path, mPaint);
    }
	

}
